Use flexible version assertions in ChangeDependencyGroupIdAndArtifactId tests#6799
Merged
Jenson3210 merged 3 commits intomainfrom Feb 23, 2026
Merged
Use flexible version assertions in ChangeDependencyGroupIdAndArtifactId tests#6799Jenson3210 merged 3 commits intomainfrom
Jenson3210 merged 3 commits intomainfrom
Conversation
…IdTest Three tests were failing because they hardcoded version 2.21.0 for jackson-jakarta-rs-json-provider, but Maven Central now resolves 2.x to 2.21.1. Switch to using spec.after() with regex pattern matching to extract and validate the resolved version dynamically.
timtebeek
reviewed
Feb 23, 2026
Use the preferred fluent AssertJ pattern that combines groupId, artifactId and version assertions into a single containsPattern call.
timtebeek
approved these changes
Feb 23, 2026
Member
timtebeek
left a comment
There was a problem hiding this comment.
Thanks a lot! Nice not to have to maintain these anymore with new releases.
1 task
knutwannheden
added a commit
that referenced
this pull request
Apr 27, 2026
ChangeDependencyGroupIdAndArtifactIdTest.noDependencyManagementSection hardcoded the post-recipe junit-jupiter version as 5.14.3, but the recipe resolves "5.x" against Maven Central at runtime. Every new junit-jupiter 5.x patch release breaks CI for every PR until someone bumps the literal. The most recent break is 5.14.4, published earlier today. Switch the assertion to a regex pattern matching any 5.x.x release, following the convention established in #6799 / #6856.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ChangeDependencyGroupIdAndArtifactIdTestfrom hardcoded version assertions to dynamic pattern matching usingspec.after()with regex and AssertJProblem
Three tests fail because they assert
<version>2.21.0</version>forjackson-jakarta-rs-json-provider, but the2.xversion pattern now resolves to2.21.1on Maven Central. These tests break every time a new Jackson 2.x version is published.Solution
Use the established
spec.after(after -> { ... })callback pattern (already used inUpgradeDependencyVersionTestand others) to:2.\d+.\d+via AssertJTests fixed:
versionNotDroppedWhenDependencyExcludedByOtherDependencyversionNotDroppedWhenTransitiveDependencyHasManagedVersionexclusionUpdatedWhenDependencyGroupIdChangesTest plan
ChangeDependencyGroupIdAndArtifactIdTestpass